package com.miplus.ccrm.core.api.dify.model;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 阻塞式调用响应.
 */
@Data
public class BlockResponse implements Serializable {
    /**
     * event
     */
    private String event;

    /**
     * message_id
     */
    private String message_id;

    /**
     * conversation_id
     */
    private String conversation_id;

    /**
     * mode
     */
    private String model;

    /**
     * answer
     */
    private String answer;

    /**
     * metadata
     */
    private Metadata metadata;

    /**
     * created_at
     */
    private Long created_at;

    @Data
    public static class Metadata {
        private Usage usage;
        private List<RetrieverResource> retriever_resources;
    }

    @Data
    public static class RetrieverResource {
        private Integer position;
        private String dataset_id;
        private String dataset_name;
        private String document_id;
        private String document_name;
        private String segment_id;
        private Double score;
        private String content;
    }

    @Data
    public static class Usage {
        private Integer prompt_tokens;
        private String prompt_unit_price;
        private String prompt_price_unit;
        private String prompt_price;
        private Integer completion_tokens;
        private String completion_unit_price;
        private String completion_price_unit;
        private String completion_price;
        private Integer total_tokens;
        private String total_price;
        private String currency;
        private Double latency;
    }

}




